home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / doc / quel / retrieve.doc < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.9 KB  |  76 lines

  1.  
  2.  
  3.  
  4.  
  5.      RETRIEVE(QUEL)               2/29/79               RETRIEVE(QUEL)
  6.  
  7.  
  8.  
  9.      NAME
  10.           retrieve - retrieve tuples from a relation
  11.  
  12.      SYNOPSIS
  13.           _r_e_t_r_i_e_v_e [[_i_n_t_o] relname] (target_list) [_w_h_e_r_e qual]
  14.           _r_e_t_r_i_e_v_e _u_n_i_q_u_e (target_list) [_w_h_e_r_e qual]
  15.  
  16.      DESCRIPTION
  17.           _R_e_t_r_i_e_v_e will get all tuples which satisfy the qualification
  18.           and either display them on the terminal (standard output) or
  19.           store them in a new relation.
  20.  
  21.           If a relname is specified, the result of the query  will  be
  22.           stored  in  a new relation with the indicated name.  A rela-
  23.           tion with this name owned by the user must not  already  ex-
  24.           ist.   The  current  user will be the owner of the new rela-
  25.           tion.  The relation will have domain names as  specified  in
  26.           the  _t_a_r_g_e_t__l_i_s_t  result_attnames.  The new relation will be
  27.           saved on the system for seven days unless  explicitly  saved
  28.           by the user until a later date.
  29.  
  30.           If the keyword _u_n_i_q_u_e is present, tuples will be  sorted  on
  31.           the first domain, and duplicates will be removed, before be-
  32.           ing displayed.
  33.  
  34.           The keyword _a_l_l can be used when it is desired  to  retrieve
  35.           all domains.
  36.  
  37.           If no result _r_e_l_n_a_m_e is specified then  the  result  of  the
  38.           query  will  be  displayed  on  the terminal and will not be
  39.           saved.  Duplicate tuples are not removed when the result  is
  40.           displayed on the terminal.
  41.  
  42.           The format in which domains are printed can  be  defined  at
  43.           the time ingres is invoked (see ingres(unix)).
  44.  
  45.           If a result relation is specified then the default procedure
  46.           is  to  modify  the  result relation to an cheapsort storage
  47.           structure removing duplicate tuples in the process.
  48.  
  49.           If the default cheapsort structure is not desired, the  user
  50.           can override this at the time INGRES is invoked by using the
  51.           -_r switch (see ingres(unix)).
  52.  
  53.           Only the relation's owner and users with retrieve permission
  54.           may _r_e_t_r_i_e_v_e from it.
  55.  
  56.      EXAMPLE
  57.           /* Find all employees who make more than their manager */
  58.              range of e is emp
  59.              range of m is emp
  60.              retrieve (e.name) where e.mgr = m.name
  61.                       and e.sal > m.sal
  62.           /* Retrieve all domains for those who make more
  63.                   than the average salary */
  64.              retrieve into temp (e.all) where e.sal > avg(e.sal)
  65.           /* retrieve employees's names sorted */
  66.              retrieve unique (e.name)
  67.  
  68.      SEE ALSO
  69.           modify(quel),   permit(quel),    quel(quel),    range(quel),
  70.           save(quel), ingres(unix)
  71.  
  72.      DIAGNOSTICS
  73.  
  74.      BUGS
  75.  
  76.